<?php

/*

Homepage (index.php)

*/
ob_start();
$interactive = 1;
$page_title = "Home";
$rank_check = 0;
include "header.inc.php";

$get_account_info = fetch("SELECT * FROM bank2 WHERE user = '$userid' AND game = '$game'");

if ($amount <= 0)
{
	die(header(error("bank.php?game=$game","Please choose a number higher then 0.")));
}

if (!is_numeric($amount))
{
	die(header(error("bank.php?game=$game","Please enter a real number.")));
}

if ($mult == -1)
{	
	if ($amount > $get_account_info[points])
	{
		die(header(error("bank.php?game=$game","You don't have that much in your account.")));
	}
	else
	{
		mysql_query("UPDATE members2 SET points=$points+$amount WHERE id = '$userid' AND game = '$game'");
		mysql_query("UPDATE bank2 SET points=$get_account_info[points]-$amount WHERE user = '$userid' AND game = '$game'");
		die(header(error("bank.php?game=$game","You have withdrawn $amount $pointsVar.")));
	}
}
if ($mult == 1)
{
	if ($amount > $points)
	{
		die(header(error("bank.php?game=$game","You can't deposit more than you have.")));
	}
	else
	{
		mysql_query("UPDATE members2 SET points=$points-$amount WHERE id = '$userid' AND game = '$game'");
		mysql_query("UPDATE bank2 SET points=$get_account_info[points]+$amount WHERE user = '$userid' AND game = '$game'");
		die(header(error("bank.php?game=$game","You have deposited $amount $pointsVar.")));
	}
}


?>
